package com.fbty.mt.action.admin;

import java.util.HashMap;
import java.util.Map;

import com.fbty.base.action.BaseAction;
import com.fbty.base.domain.Page;
import com.fbty.mt.service.UserIpInfoService;

public class ManagerUIPAction extends BaseAction {
	private static final long serialVersionUID = 1L;

	
	private String username="";
	
	private String type="";
	
	private String country="";
	
	private String region="";
	
	private String city="";

	private Page page;
	
	private UserIpInfoService userIpInfoService;
	
	private int pageNo=1;
	
	private int pageSize=20;
	public String execute(){
		Map<String,String> map = new HashMap<String,String>();
		if(username!=null&&!"".equals(username)){
			map.put("u.username", username);
		}
		Map<String,String> parms = new HashMap<String,String>();
		parms.put("oi.region", "%"+region+"%");
		parms.put("oi.type","".equals(type)?"%"+type+"%":type);
		parms.put("oi.country", "%"+country+"%");
		parms.put("oi.city", "%"+city+"%");
		try {
			page = userIpInfoService.queryAllUserIp(pageNo, pageSize, map,parms);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "success";
	}

	public Page getPage() {
		return page;
	}

	public void setUsername(String username) {
		this.username = username;
	}
	

	public String getUsername() {
		return username;
	}

	public void setUserIpInfoService(UserIpInfoService userIpInfoService) {
		this.userIpInfoService = userIpInfoService;
	}

	public int getPageNo() {
		return pageNo;
	}

	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}

	public int getPageSize() {
		return pageSize;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getRegion() {
		return region;
	}

	public void setRegion(String region) {
		this.region = region;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}
	
	
	
}
